﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace XMLGener.Data
{
    /// <summary>
    /// 
    /// </summary>
    public class XMLGenerMainElement:XMLGenerElement
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="xmlElem"></param>
        public XMLGenerMainElement( XmlElement xmlElem)
            : base(null,xmlElem)
        {
            this.xtype = XNodeType.ELEMENT;
            this.minCount = 1;
            this.maxCount = 1;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="parent"></param>
        public XMLGenerMainElement(XMLGenerNode parent)
            : base(XMLGenerNode.XMAINELEMENT_STR, parent)
        {
            this.xtype = XNodeType.ELEMENT;
            this.minCount = 1;
            this.maxCount = 1;


        }
        /// <summary>
        /// 
        /// </summary>
        protected override void defaultInitialization()
        {
            base.defaultInitialization();
            this.nodeTypeStr = XMLGenerNode.XMAINELEMENT_STR;
        }

        /// <summary>
        /// Default depth of main element is 0;
        /// </summary>
        public override int depth
        {
            get
            {
                if (_depth < 0 )
                {
                    this._depth = 0;
                }
                return _depth;
            }
            set { this._depth = value; }
        }


        //---------------------------
        // attributes from xml
        //---------------------------
        /// <summary>
        /// 
        /// </summary>
        public string outId
        {
            get { return getXMLParam("outputId"); }
            set { setXMLParam("outputId", value); }
        }

    }
}
